package com.lyf.design.summary.njusoftware.dip;

/**
 * @author liyunfei
 */
public class DipDemo {
    interface InterfaceA{void method();}
    private static class A{
    
    }
    private static class A1 implements InterfaceA{
        @Override
        public void method() {
        
        }
    }
    private static class B{
        InterfaceA a;
        A1 A1;
        // 注入A
        public void setA(InterfaceA a) {
            this.a = a;
        }
        public void setA1(DipDemo.A1 a1) {
            A1 = a1;
        }
    }
}
